//8-3编码器-行为描述
//a:输入，位宽为8的独热信号
//b:输出，位宽为3的二进制码
module Enc83(a,b);
  input [7:0] a;
  output [2:0] b;
  reg [2:0] b;
  always @(*) begin
      case(a)
	  8'h01:b=3'd0;
	  8'h02:b=3'd1;
	  8'h04:b=3'd2;
	  8'h08:b=3'd3;
	  8'h10:b=3'd4;
	  8'h20:b=3'd5;
	  8'h40:b=3'd6;
	  8'h80:b=3'd7;
	  default:b=3'bxxx;
      endcase
  end
endmodule
